#include "udp_server.hpp"
#include "err.hpp"
#include <memory>
#include <string>
using namespace ns_server;

static void usage(std::string proc)
{
    std::cout << "Usage:\n\t" << proc << "port\n" << std::endl;
}

int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t port = atoi(argv[1]);
    // std::unique_ptr<UdpServer> pus(new UdpServer("127.0.0.0", port));
    std::unique_ptr<UdpServer> pus(new UdpServer(port));
    pus->InitServer();
    pus->Start();
    return 0;
}